package ch.fhnw.qualiscan.core.db.pojos;

import java.io.Serializable;
import java.util.HashSet;
import java.util.Set;
import java.util.TreeSet;


/**
 * This pojo holds the information about questions. It is used by hibernate to get data out of the database.
 * @author Kevin Mettenberger
 *
 */
@SuppressWarnings("serial")
public class Question implements Serializable {
	
	private int id;
	private Set questiontext = new HashSet();
	private Domain domain;
	private Set subquestions = new HashSet();
	private Set answers = new HashSet();
	private Question parentQuestion;
	

	public int getId() {
		return id;
	}
	
	public void setId(int id) {
		this.id = id;
	}
	
	public Set getQuestiontext() {
		return questiontext;
	}

	public void setQuestiontext(Set questiontexts) {
		this.questiontext = questiontexts;
	}
	
	public void addQuestiontext(QuestionText questiontext) {
		this.questiontext.add(questiontext);
	}
	public void removeQuestiontext(QuestionText questiontext) {
		this.questiontext.remove(questiontext);
	}

	public Domain getDomain() {
		return domain;
	}

	public void setDomain(Domain domain) {
		this.domain = domain;
	}

	public Set getSubquestions() {
		return subquestions;
	}

	public void setSubquestions(Set subquestions) {
		this.subquestions = subquestions;
	}	
	
	public void addSubquestion(Question subquestion) {
		this.subquestions.add(subquestion);
	}
	
	public void removeSubquestion(Question subquestion) {
		this.subquestions.remove(subquestion);
	}
	public Set getAnswers() {
		return answers;
	}

	public void setAnswers(Set answers) {
		this.answers = answers;
	}
	
	public void addAnswer(Answer answer) {
		this.answers.add(answer);
	}
	
	public void removeAnswer(Answer answer) {
		this.answers.remove(answer);
	}

	public Question getParentQuestion() {
		return parentQuestion;
	}

	public void setParentQuestion(Question parentQuestion) {
		this.parentQuestion = parentQuestion;
	}
	
	
	
	
	
	
}
